package com.PVZ.model.zombie;

import com.PVZ.model.Anime;
import com.PVZ.model.emuns.AnimeType;
import com.PVZ.model.emuns.Configs;
import com.PVZ.model.emuns.MoveType;
import com.PVZ.model.emuns.ZombieType;
import com.PVZ.utils.Util;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author ISY
 * @create 2021-06-05 13:31
 */
@Getter
@Setter
public class FlagZombie extends Zombie {
    public FlagZombie(int row, int col, MoveType moveType){
        super(ZombieType.FlagZombie,row,col,-70,-50,1);
        this.setMoveType(moveType);
        this.setHealth(Configs.zombieHealth.get(ZombieType.NormalZombie));
        this.setBoxPadding(-20,-20 , -20, -20);
        setAnime();
    }
    public FlagZombie(){
        super(ZombieType.NormalZombie);
        this.setHealth(Configs.zombieHealth.get(ZombieType.NormalZombie));
        this.setImgSrc("res/img/zombiePng/FlagZombie/move/Move-0.png");
        setAnime();
    }

    @Override
    public void setAnime() {
        Map<AnimeType, Anime> animeMap=new HashMap<>();
        //图片文件夹地址
        String src="res/img/zombiePng/FlagZombie/move";

        int starIndex=0;
        int endIndex=11;

        Anime anime=Util.createAnime(src, "Move", starIndex, endIndex, -1);

        animeMap.put(AnimeType.MOVE, anime);

        animeMap.put(AnimeType.BREAK, getNormalZombieDeid());

        animeMap.put(AnimeType.ATTACK,getAttackAnime());


        setAnimeMap(animeMap);
    }
    public Anime getAttackAnime() {
        String src="res/img/zombiePng/FlagZombie/attack";

        int starIndex=0;
        int endIndex=20;

        return Util.createAnime(src, "Attack", starIndex, endIndex, -1);
    }
}
